package com.mrinalwadhwa.effects.tint
{
	import com.mrinalwadhwa.effects.BendPixels;
	import flash.utils.ByteArray;
	import mx.effects.IEffectInstance;
	
	public class TintEffect extends BendPixels{

		[Embed("Tint.pbj", mimeType="application/octet-stream")]
		private var TintFilter:Class;

		public static const MIN_AMOUNT:Number = -1; 
		public static const MAX_AMOUNT:Number = 1; 
		public static const DEFAULT_AMOUNT:Number = 0; 

		public static const MIN_COLOR:Number = 0; 
		public static const MAX_COLOR:Number = 1; 
		public static const DEFAULT_COLOR:Number = 0; 


		[Inspectable(category="General")]
		public var fromAmount:Number;
		
		[Inspectable(category="General")]
		public var toAmount:Number;

		[Inspectable(category="General")]
		public var fromRed:Number = DEFAULT_COLOR;
		
		[Inspectable(category="General")]
		public var toRed:Number  = DEFAULT_COLOR;

		[Inspectable(category="General")]
		public var fromGreen:Number  = DEFAULT_COLOR;
		
		[Inspectable(category="General")]
		public var toGreen:Number  = DEFAULT_COLOR;

		[Inspectable(category="General")]
		public var fromBlue:Number  = DEFAULT_COLOR;

		[Inspectable(category="General")]
		public var toBlue:Number  = DEFAULT_COLOR;



		public function TintEffect(target:Object=null){
			super(target);
		}
		
        override protected function initInstance(inst:IEffectInstance):void {
			
			benderByteArray = new TintFilter() as ByteArray
			benderParams = [
								['amount',fromAmount,toAmount],
								[ 
								  'color',
								  [fromRed,fromGreen,fromBlue],
								  [toRed,toGreen,toBlue]
								]
							];	
							
            super.initInstance(inst);
        } 		

	}
}